﻿using System;
using System.Text;
using Nop.Core.Domain.Media;

namespace Nop.Web.CDN.Models.Picture
{
    public class PicturePathInfoModel
    {
        public int PictureId { get; set; }
        public int TargetSize { get; set; }
        // picture type.
        public PictureType PictureType { get; set; }
        /// <summary>
        /// Gets or sets the extension .jpg, .gif,.png,.icon
        /// </summary>
        /// <value>The extension.</value>
        public string Extension { get; set; }

        /// <summary>
        /// Gets the picture hash key.
        /// </summary>
        /// <returns>The picture hash key.</returns>
        public string GetPictureHashKey()
        {
            // if width equals 0 or height equals 0 show full size picture.
            var hashString = string.Join("_", new string[] { PictureType.ToString(), PictureId.ToString(), TargetSize.ToString(), Extension });
            return hashString;
        }
    }
}

